package org.eece262.taskshareserver;

import java.io.Serializable;

import org.edu.eece262.taskshare.Messages;
import org.edu.eece262.taskshare.Messages.GroupMember;

public class GroupMembership implements Serializable {

	private static final long serialVersionUID = 7672605587019964714L;

	private String groupMemberUser;
    
    public static class StatusType {
    	public static final int ACTIVE = 0;
    	public static final int REQUESTED = 1;
    	public static final int WAITING = 2; 
    	public static final int ACCEPTED = 3;
    	public static final int DELTETED = 4;
    }
    
    private int groupMemberStatus;
    
    public static class RollType {
    	public static final int OWNER = 0;
    	public static final int ADMIN = 1;
    	public static final int USER = 2; 
    }
    
    private int groupMemberRoll;

    public GroupMembership() { }
    
    public GroupMembership(Messages.GroupMember member) {
    	this.groupMemberRoll = member.getGroupMemberRoll();
    	this.groupMemberStatus = member.getGroupMemberStatus();
    	this.groupMemberUser = member.getGroupMemberUser();
    }
    
    public Messages.GroupMember getMessagesGroupMember() {
    	return new GroupMember(groupMemberUser, groupMemberStatus, groupMemberRoll);
    }

	public String getGroupMemberUser() {
		return groupMemberUser;
	}


	public GroupMembership setGroupMemberUser(String groupMemberUser) {
		this.groupMemberUser = groupMemberUser;
		return this;
	}


	public int getGroupMemberStatus() {
		return groupMemberStatus;
	}


	public GroupMembership setGroupMemberStatus(int groupMemberStatus) {
		this.groupMemberStatus = groupMemberStatus;
		return this;
	}


	public int getGroupMemberRoll() {
		return groupMemberRoll;
	}


	public GroupMembership setGroupMemberRoll(int groupMemberRoll) {
		this.groupMemberRoll = groupMemberRoll;
		return this;
	}
}
